{% for item in groups['all'] %}
Host cluster-{{ item }}
  Hostname {{ hostvars[item].nauta_configuration.internal_interface.ipv4_address }}
  User cluster-client
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/id_rsa
  StrictHostKeyChecking no
  GlobalKnownHostsFile=/dev/null
  UserKnownHostsFile=/dev/null
{% endfor %}

{% if inventory_hostname in groups['master'] %}
{% for item in groups['master'] %}
Host master-cluster-{{ item }}
  Hostname {{ hostvars[item].nauta_configuration.internal_interface.ipv4_address }}
  User cluster-master
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/id_rsa
  StrictHostKeyChecking no
  GlobalKnownHostsFile=/dev/null
  UserKnownHostsFile=/dev/null
{% endfor %}
{% endif %}
